FROM node:8.2.1

# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app

COPY ./node_modules /usr/src/app/node_modules

RUN npm set registry http://r.cnpmjs.org/

RUN ./node_modules/pm2/bin/pm2 install pm2-logrotate

RUN ./node_modules/pm2/bin/pm2 set pm2-logrotate:max_size 10M

# EXPOSE 3018

CMD ["./node_modules/pm2/bin/pm2-docker", "process.yml"]
# CMD exec ./node_modules/pm2/bin/pm2-docker process.yml --env ${env}